export const permission = (app) => {
  app.directive("permission", {
    mounted(el, binding) {
      const value = binding.value;
      let roleList = [];
      if (localStorage.getItem("user")) {
        roleList = JSON.parse(
          JSON.parse(localStorage.getItem("user")).role.roleJson
        );
      }
      if (!roleList.includes(value)) {
        // el.style.display = "none";
        el.parentNode.removeChild(el);
      }
    },
  });
};
